{% extends 'admins.html' %}

{% block content %}

{% if data %}
<h3>{{ title }}</h3>
{% else %}
<h3>我是添加页面</h3>
{% endif %}


    <!-- 定义宏 -->
{% macro input(for="",label="", type="text", name="",id="", value="",pl="") %}
     <div class="form-group">
<label for="{{ for }}" class="col-sm-2 control-label">{{ label }}</label>
      <div class="col-sm-8">
    <input type="{{ type }}" name="{{ name }}"  class="form-control" id="{{ id }}" value="{{ value }}" placeholder="{{ pl }}">
      </div>
  </div>
{% endmacro %}


   <!-- 调用宏 -->
<form class="form-horizontal" style="margin: 80px auto" method="post">
     <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

    {% if data %}
 {{ input("inputEmail3","代号", name="dh",id='inputEmail3',value=data.name,pl='请输入代号') }}
 {{ input("inputEmail4","码龄", name="ml",id='inputEmail4',value=data.codecoll,pl='请输入码领') }}
 {{ input("inputEmail5","语言", name="yy",id='inputEmail5',value=data.echnology ,pl='请输入语言') }}
 {{ input("inputEmail6","方向", name="fx",id='inputEmail6',value=data.direction ,pl='请输入方向') }}
 {{ input("inputEmail7","薪资", name="xz",id='inputEmail7',value=data.price ,pl='请输入薪资') }}
 {% else %}
     {{ input("inputEmail3","代号", name="dh",id='inputEmail3',pl='请输入代号') }}
 {{ input("inputEmail4","码龄", name="ml",id='inputEmail4',pl='请输入码领') }}
 {{ input("inputEmail5","语言", name="yy",id='inputEmail5',pl='请输入语言') }}
 {{ input("inputEmail6","方向", name="fx",id='inputEmail6',pl='请输入方向') }}
 {{ input("inputEmail7","薪资", name="xz",id='inputEmail7',pl='请输入薪资') }}

 {% endif %}
    <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-success" >{% if not data %}添加{% else %}修改{% endif %}</button>
    </div>
  </div>

</form>


{% endblock %}